<?php
    class Admin extends Admin_Controller{
        function __construct(){
            parent::__construct();
        }
        function index(){
            redirect('admin_content');       
        }
        function login(){
            $config = array(
            array(
            'field'   => 'email',
            'label'   => 'Email',
            'rules'   => 'required|valid_email'
            ),
            array(
            'field'   => 'password',
            'label'   => 'Password',
            'rules'   => 'required'
            )
            );

            $this->form_validation->set_rules($config); 
            if($this->input->post('submit')){
                if($this->form_validation->run()){
             $this->session->set_flashdata('error', 'Login vo van qua');
              $this->load->view('admin/login');  
                } else{
                    //echo 'form fails';die;
                    //$this->session->set_flashdata('error', 'Login vo van qua');
                    $this->load->view('admin/login');    
                }    
            } else{
                $this->load->view('admin/login');
            }
        }
    }
?>
